# -*- coding: utf-8 -*-

"""
DateTime   : 2021/02/14 21:40
Author     : ZhangYafei
Description: 
"""
import requests

# 请求的网址
url = "http://www.baidu.com"
# 请求头
headers = {"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36'}
# 请求网址
response = requests.get(url=url, headers=headers)
# 响应体内容
print(response.text)
# 响应状态信息
print(response.status_code)
# 响应头信息
print(response.headers)

# 请求头
print(response.request.headers)
# 请求url
print(response.request.url)
# 请求体
print(response.request.body)
# 请求方法
print(response.request.method)
